Tables [dbo].[DocumentStorage]
Properties
PropertyValue
Created10:31:20 AM Tuesday, March 02, 2010
Last Modified1:20:14 PM Thursday, February 23, 2012
Columns
NameData TypeMax Length (Bytes)Allow Nulls
Cluster Primary Key PK_DocumentStorage: DocumentStorageKeyDocumentStorageKeyuniqueidentifier16
No
Namenvarchar(50)100
No
Descriptionnvarchar(200)400
Yes
Foreign Keys FK_DocumentStorage_FileTypeRef: [dbo].[FileTypeRef].FileTypeCodeIndexes IX_DocumentStorage_FileTypeCode: FileTypeCodeFileTypeCodenvarchar(4)8
Yes
Foreign Keys FK_DocumentStorage_UserMain_CreatedBy: [dbo].[UserMain].CreatedByUserKeyIndexes IX_DocumentStorage_CreatedByUserKey: CreatedByUserKeyCreatedByUserKeyuniqueidentifier16
No
CreatedOndatetime8
No
Foreign Keys FK_DocumentStorage_UserMain_UpdatedBy: [dbo].[UserMain].UpdatedByUserKeyIndexes IX_DocumentStorage_UpdatedByUserKey: UpdatedByUserKeyUpdatedByUserKeyuniqueidentifier16
No
UpdatedOndatetime8
No
Foreign Keys FK_DocumentStorage_UserMain_UploadedBy: [dbo].[UserMain].UploadedByUserKeyIndexes IX_DocumentStorage_UploadedByUserKey: UploadedByUserKeyUploadedByUserKeyuniqueidentifier16
Yes
UploadedOnuniqueidentifier16
Yes
Blobimagemax
Yes
MarkedForDeleteOndatetime8
Yes
Indexes Indexes
NameColumnsUnique
Cluster Primary Key PK_DocumentStorage: DocumentStorageKeyPK_DocumentStorageDocumentStorageKey
Yes
IX_DocumentStorage_CreatedByUserKeyCreatedByUserKey
IX_DocumentStorage_FileTypeCodeFileTypeCode
IX_DocumentStorage_UpdatedByUserKeyUpdatedByUserKey
IX_DocumentStorage_UploadedByUserKeyUploadedByUserKey
Foreign Keys Foreign Keys
NameColumns
FK_DocumentStorage_FileTypeRefFileTypeCode->[dbo].[FileTypeRef].[FileTypeCode]
FK_DocumentStorage_UserMain_CreatedByCreatedByUserKey->[dbo].[UserMain].[UserKey]
FK_DocumentStorage_UserMain_UpdatedByUpdatedByUserKey->[dbo].[UserMain].[UserKey]
FK_DocumentStorage_UserMain_UploadedByUploadedByUserKey->[dbo].[UserMain].[UserKey]
SQL Script
CREATE TABLE [dbo].[DocumentStorage]
(
[DocumentStorageKey] [uniqueidentifier] NOT NULL,
[Name] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Description] [nvarchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[FileTypeCode] [nvarchar] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[CreatedByUserKey] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedByUserKey] [uniqueidentifier] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[UploadedByUserKey] [uniqueidentifier] NULL,
[UploadedOn] [uniqueidentifier] NULL,
[Blob] [image] NULL,
[MarkedForDeleteOn] [datetime] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
ALTER TABLE [dbo].[DocumentStorage] ADD CONSTRAINT [PK_DocumentStorage] PRIMARY KEY CLUSTERED ([DocumentStorageKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_DocumentStorage_CreatedByUserKey] ON [dbo].[DocumentStorage] ([CreatedByUserKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_DocumentStorage_FileTypeCode] ON [dbo].[DocumentStorage] ([FileTypeCode]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_DocumentStorage_UpdatedByUserKey] ON [dbo].[DocumentStorage] ([UpdatedByUserKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_DocumentStorage_UploadedByUserKey] ON [dbo].[DocumentStorage] ([UploadedByUserKey]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DocumentStorage] ADD CONSTRAINT [FK_DocumentStorage_FileTypeRef] FOREIGN KEY ([FileTypeCode]) REFERENCES [dbo].[FileTypeRef] ([FileTypeCode])
GO
ALTER TABLE [dbo].[DocumentStorage] ADD CONSTRAINT [FK_DocumentStorage_UserMain_CreatedBy] FOREIGN KEY ([CreatedByUserKey]) REFERENCES [dbo].[UserMain] ([UserKey])
GO
ALTER TABLE [dbo].[DocumentStorage] ADD CONSTRAINT [FK_DocumentStorage_UserMain_UpdatedBy] FOREIGN KEY ([UpdatedByUserKey]) REFERENCES [dbo].[UserMain] ([UserKey])
GO
ALTER TABLE [dbo].[DocumentStorage] ADD CONSTRAINT [FK_DocumentStorage_UserMain_UploadedBy] FOREIGN KEY ([UploadedByUserKey]) REFERENCES [dbo].[UserMain] ([UserKey])
GO
Uses